package com.learn.algorithm.designpattern.chain;

import java.util.Objects;
import java.util.StringJoiner;

/**
 * @author wangxing
 * @version 2020/7/22 13:30 Administrator
 * stratgey
 *
 */
public class RequestTemp {
    private String name;
    private String password;

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    private String role;

    public RequestTemp(String name, String password, String role) {
        this.name = name;
        this.password = password;
        this.role = role;
    }
    public boolean equalsNamePassword(Object o) {
        if (this == o) return true;
        if (!(o instanceof RequestTemp)) return false;
        RequestTemp that = (RequestTemp) o;
        return name.equals(that.name) &&
                password.equals(that.password);
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof RequestTemp)) return false;
        RequestTemp that = (RequestTemp) o;
        return name.equals(that.name) &&
                password.equals(that.password) &&
                role.equals(that.role);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, password, role);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public RequestTemp(String name, String password) {
        this.name = name;
        this.password = password;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", RequestTemp.class.getSimpleName() + "[", "]")
                .add("name='" + name + "'")
                .add("password='" + password + "'")
                .add("role='" + role + "'")
                .toString();
    }
}
